<?php use_javascript('/js/form.js')?>
<?php use_javascript('/js/jsDatePick.min.1.3.js')?>
<?php use_stylesheet('/css/datepick/jsDatePick_ltr.min.css')?>

<div class="admin_form_row">
  <div>
  <?php if ($form['carga_horaria']->hasError()): ?>
  <div class="error">Algunos campos son obligatorios</div>
  <?php endif; ?>
  <?php echo $form['carga_horaria']->renderLabel() ?>
  </div>
</div>
<div class="admin_form_row">
  <div>
    <table id="tbCargaHoraria" class="form_table">
      <thead>
        <tr>
          <th></th>
          <th>Horario</th>
          <th>Días</th>
          <th>Paralelo</th>
          <th>Fecha inicio</th>
          <th>Fecha fin</th>
          <th>Observaciones</th>
        </tr>
      </thead>
      <tbody>
      <?php foreach ($form['carga_horaria'] as $cargaForm): ?>
        <?php include_partial('carga_horaria_fields', array('cargaForm' => $cargaForm))?>
      <?php endforeach; ?>
      </tbody>
    </table>
    <br>
    <ul class="admin_actions">
        <li class="admin_action_new"><a href="#" id="addCarga">Agregar carga horaria</a></li>
    </ul>
  </div>
</div>

<script type="text/javascript">
  /* <![CDATA[ */
  //form.js
  iniciaTablaForm('#tbCargaHoraria', '#addCarga', '.delCarga', '<?php echo url_for('@planificacion_agregaCarga')?>');
  /* ]]> */
</script>